package org.proddevplm.dao.data.blocks;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.HashMap;
import java.util.Map;

/**
 * Represents the project flow object to be serialized and stored into database.
 * This object stores all public fields defined by the flow blocks, nodes and links
 */

@XStreamAlias("project")
public class ProjectFlow extends Identifier {

    /**
     * Public fields used to evaluate (if) statements
     */
    @XStreamAlias("fields")
    private Map<String, FlowField> publicFields = new HashMap<String, FlowField>();

    /**
     * All flow nodes
     */
    @XStreamAlias("nodes")
    private Map<String, Node> flowNodes = new HashMap<String, Node>();

    /**
     * Current node. Stores current state.
     * On new project the current node is the first node addded to the project. (Starting point)
     */
    @XStreamAlias("currentNode")
    private String currentNode;


    public Map<String, FlowField> getPublicFields() {
        return publicFields;
    }

    public Map<String, Node> getFlowNodes() {
        return flowNodes;
    }

    public String getCurrentNode() {
        return currentNode;
    }

    public void setCurrentNode(String currentNode) {
        this.currentNode = currentNode;
    }
}
